
export class Assets
{
    public static Prefabs:string = "Prefabs/";
    
    public static Scenes:string = "";

    public static Audios:string = "Audios/";

    public static Textures:string = "Textures/";

    public static Languages:string = "Languages/";

    public static Fonts:string = "Textures/Fonts/";
    public static Audio:string= "Audios/";

    public static GetAudio(audioName:string):string
    {
        return this.Audio+audioName;
    }

    public static GetPrefab(prefabName:string):string
    {
        if(prefabName.indexOf(this.Prefabs)==0)return prefabName;
        return this.Prefabs+prefabName;
    }
    public static GetTexture(assetName:string,extension:string = "png"):string
    {
        if(CC_EDITOR)
        {
            if(assetName.indexOf(":")!=-1)return "resources/"+this.Textures+assetName;
            return "resources/"+this.Textures+assetName+"."+extension;
        }
        return (this.Textures+assetName);
    }
    public static GetFonts(assetName:string):string
    {
        if(CC_EDITOR)return "resources/"+this.Fonts+assetName+".fnt";
        return this.Fonts+assetName;
    }

    public static GetAssets(assets:any[]):string[]
    {
        for (let i = 0; i < assets.length; i++) 
        {
            if(typeof assets[i]==="string")
                assets[i] = this.GetPrefab(assets[i]);
        }
        return assets;
    }

    public static GetLanguage(languageName:string):string
    {
        if(CC_EDITOR)return "resources/"+this.Languages+languageName+".json";
        return this.Languages+languageName;
    }

}
